package com.cyj.dream.auth;

import cn.hutool.core.date.DateUtil;
import com.cyj.dream.auth.constant.Auth2Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;

/**
 * @Description: 单点登录认证中心启动类--https://segmentfault.com/a/1190000021980130
 * https://blog.csdn.net/u013783065/article/details/108528766
 * @BelongsProject: DreamChardonnay
 * @BelongsPackage: com.cyj.dream.auth
 * @Author: ChenYongJia
 * @CreateTime: 2021-09-30 10:08
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
@Slf4j
@EnableFeignClients
//对外开启暴露获取token的API接口
@EnableResourceServer
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = {Auth2Constants.SCAN_BASE_PACKAGES})
public class DreamAuthApplication {

    /**
     * 项目启动方法
     *
     * @param args the input arguments
     * @date 2021-9-26
     * @author Sunny Chen
     */
    public static void main(String[] args) {
        log.info("梦享云--单点登录认证中心项目开始启动ing！======>{}", DateUtil.now());
        SpringApplication.run(DreamAuthApplication.class, args);
        log.info("梦享云--单点登录认证中心项目启动成功ing.......！======>{}", DateUtil.now());
    }

}
